{% extends "core/base.html/" %}
{% block title %} Каталог {% endblock %}
{% block content %}
<div class="container-fluid">
  <h1>Заголовок</h1>
  <div class="d-flex gap-2">
    {% for i in shop %}
    <div class="card" style="width: 20rem;">
      <img src="{{i.image.url}}" class="card-img-top" alt="...">
      <div class="card-body">
        <h5 class="card-title fs-1">{{ i.name }}</h5>
        <p class="card-text">{{ i.discription }}</p>
        {% for j in '*****' %}
        {% if forloop.counter <= i.rating %} <img src="https://img.icons8.com/color/48/army-star.png">
          {% else %}
          <img src="https://img.icons8.com/color/48/army-star.png" style="filter: grayscale(1);">
          {% endif %}
          {% endfor %}
          <h2 class="card-rating">{{i.rating}}</h2>
          {% if i.is_avaiable %}
          <a href="{%url 'product_detail' product_id=i.id%}" class="btn btn-primary">Перейти к товару</a>
          {% else %}
          <a href="{%url 'product_detail' product_id=i.id%}" class="btn btn-primary">Недоступно</a>
          {% endif %}
      </div>
    </div>
    {% endfor %}
  </div>
</div>
{% endblock %}